package com.hangzhou.xyj.net.request;

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.hangzhou.xyj.net.request.base.BaseRequest;
import com.hangzhou.xyj.utils.constants.API;

/**
 * Created by neo.duan on 2016/4/28.
 * 申请加入圈子
 */
public class JoinGroupReq extends BaseRequest {

    public JoinGroupReq(String userId, String groupId) {
//        {"groupId":1,"userId":1}
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("userId", valueOf(userId));
        jsonObject.addProperty("groupId", valueOf(groupId));
        String jsonStr = new Gson().toJson(jsonObject);
        add("data", jsonStr);
    }

    @Override
    public String getUrl() {
        return API.JOIN_GROUP;
    }
}
